/**
 * @ Author 何涛
 * @ Date 2016/02/19 01:08:29
*/

tyNamespace.AnimationManager = cc.Class.extend({
    //node缓慢移动出现,消失
    nodeShow: function (node, offset) {
        if (!node)
            return;
        var action = cc.moveBy(1, cc.p(0, offset)).easing(cc.easeSineOut());
        node.runAction(action);
    },

    nodeHide: function (node, offset) {
        if (!node)
            return;
        var action = cc.moveBy(1, cc.p(0, offset)).easing(cc.easeSineIn());
        node.runAction(action);
    },

    //node全屏出现，隐藏
    nodeJumpShow: function (node, offset) {
        if (!node)
            return;
        var action = cc.moveBy(1 / 3, cc.p(0, offset)).easing(cc.easeBackOut());
        node.runAction(action);
    },

    nodeJumpHide: function (node, offset) {
        if (!node)
            return;
        var action = cc.moveBy(1 / 3, cc.p(0, offset)).easing(cc.easeBackIn());
        node.runAction(action);
    },

    //node时间冒号表现
    nodeFadeInOut: function (node) {
        if (!node)
            return;
        var action = cc.repeatForever(cc.sequence(cc.fadeOut(1), cc.fadeIn(1)));
        node.runAction(action);
    },
    nodeDaxiaoda: function (node, time, scale) {
        if (!node)
            return;
        node.runAction(cc.sequence(cc.scaleTo(time/3, 1+scale, 1+scale), cc.scaleTo(time/3, 1-scale, 1-scale), cc.scaleTo(time/3, 1, 1)));
    }
});

tyNamespace.AnimationManager = new tyNamespace.AnimationManager();